package 剑指offer;

public class _5二进制中1的个数 {
    public int hammingWeight(int n) {
        int res = 0;
        while(n != 0){
            res = res + (n & 1);
            n = n>>>1;
        }
        return res;
    }
}
